<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentname</title>
  </head>

  <body>
    <div id="wrapDemo"></div>

    <script id="myTmpl" type="text/x-jquery-tmpl">
      The following wraps and reorders some HTML content:
      {{wrap "#tableWrapper"}}
          <h3>One</h3>
          <div>
              First <b>content</b>
          </div>
          <h3>Two</h3>
          <div>
              And <em>more</em> <b>content</b>...
          </div>
      {{/wrap}}
    </script>

    <script id="tableWrapper" type="text/x-jquery-tmpl">
      <table cellspacing="0" cellpadding="3" border="1"><tbody>
          <tr>
              {{each $item.html("h3", true)}}
                  <td>
                      ${$value}
                  </td>
              {{/each}}
          </tr>
          <tr>
              {{each $item.html("div")}}
                  <td>
                      {{html $value}}
                  </td>
              {{/each}}
          </tr>
      </tbody></table>
    </script>

    <script
      type="text/javascript"
      src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.min.js"
    ></script>
    <script type="text/javascript" src="./9/jquery.tmpl.min.js"></script>
    <script type="text/javascript">
      $(function () {
        var users = [
          { id: 'think8848', name: ['Joseph', 'Chan'] },
          { id: 'aCloud', name: ['Mary', 'Cheung'] },
        ]
        $('#myTmpl').tmpl().appendTo('#wrapDemo')
        $('#tableWrapper').tmpl(users)
      })
    </script>
  </body>
</html>
